package com.estate.system.domain.vo;

import com.estate.system.domain.report.boss.timeTrends.DayOfWeekRequest;
import com.estate.system.domain.report.boss.timeTrends.HourlyRequest;
import com.estate.system.domain.report.boss.timeTrends.MonthlyTrendPoint;

import java.util.ArrayList;
import java.util.List;

public class TimeTrendDataGenerator {
    
    public static List<MonthlyTrendPoint> createMonthlyTrendPointData() {
        List<MonthlyTrendPoint> monthlyTrendPointList = new ArrayList<>();
        // 添加月度趋势数据（折线图）
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-01", 5));
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-02", 7));
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-03", 4));
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-04", 8));
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-05", 6));
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-06", 9));
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-07", 3));
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-08", 7));
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-09", 10));
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-10", 5));
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-11", 8));
        monthlyTrendPointList.add(new MonthlyTrendPoint("2020-12", 6));
        return monthlyTrendPointList;
    }
    public static List<DayOfWeekRequest> createDayOfWeekRequestData() {
        List<DayOfWeekRequest> monthlyTrendPointList = new ArrayList<>();

        // 添加星期几请求数据（左下方柱状图）
        monthlyTrendPointList.add(new DayOfWeekRequest("Monday", 8));
        monthlyTrendPointList.add(new DayOfWeekRequest("Tuesday", 10));
        monthlyTrendPointList.add(new DayOfWeekRequest("Wednesday", 12));
        monthlyTrendPointList.add(new DayOfWeekRequest("Thursday", 9));
        monthlyTrendPointList.add(new DayOfWeekRequest("Friday", 11));
        monthlyTrendPointList.add(new DayOfWeekRequest("Saturday", 6));
        monthlyTrendPointList.add(new DayOfWeekRequest("Sunday", 4));
        return monthlyTrendPointList;
    }
    public static List<HourlyRequest> createHourlyRequestData() {
        List<HourlyRequest> hourlyRequestList = new ArrayList<>();

        // 添加小时请求数据（右下方柱状图）
        for (int hour = 0; hour < 24; hour++) {
            int requestCount = 0;
            // 模拟数据：大多数时段请求量较低，个别时段有峰值
            if (hour == 9) requestCount = 8;  // 上午9点峰值
            else if (hour == 14) requestCount = 6; // 下午2点峰值
            else if (hour == 18) requestCount = 5; // 下午6点峰值
            else if (hour >= 8 && hour <= 17) requestCount = 2; // 工作时间基础请求
            else requestCount = 1; // 其他时间少量请求

            hourlyRequestList.add(new HourlyRequest(hour, requestCount));
        }
        return hourlyRequestList;
    }
}